<template>
	<view class="acceptanceDetail">
		<view class="card">
			<image class="head-img" src="http://51-jzt-dev.oss-cn-hangzhou.aliyuncs.com/miniapp/acceptance-head.png" mode=""></image>
			<view class="head-title">{{ detailData.craftName }}</view>
			<view class="title">
				<view class="tag">
					{{ detailData.procedureName }}
				</view>
			</view>
		</view>
		<view class="desc">
			<view class="desc-title">验收描述</view>
			<view class="text">{{ detailData.checkDesc }}</view>
		</view>
		<view class="desc">
			<view class="desc-title">验收图片凭据</view>
			<view class="img-list">
				<image @click="previewImage(splitStrToArray(detailData.picUrls),index)" v-for="img,index in splitStrToArray(detailData.picUrls)" :src="img">
				</image>
			</view>
			<Empty v-if="!splitStrToArray(detailData.picUrls).length"/>
		</view>
		<view class="desc">
			<view class="desc-title">验收视频凭据</view>
			<view class="img-list">
				<video id="myVideo" v-for="video in splitStrToArray(detailData.videoUrls)" :src="video"
					:danmu-list="danmuList"></video>
			</view>
			<Empty v-if="!splitStrToArray(detailData.videoUrls).length"/>
		</view>
	</view>
</template>

<script setup>
import { ref } from "vue";
import { onLoad } from '@dcloudio/uni-app'
import { getDetail } from "@/api/acceptance";
import Empty from "@/components/empty/index.vue";
import { previewImage,splitStrToArray } from "@/utils/utils";
const query = ref({});
const detailData = ref({})
/**
 * 获取详情
 */
const getDetailData = async () => {
	try {
		const res = await getDetail(query.value);
		detailData.value = res.data;
	} catch (error) {
		console.log(error)
	}
}
onLoad((e) => {
	query.value.checkId = e.checkId;
	getDetailData()
})
</script>

<style lang="scss" scoped>
@import "standard";
</style>
